package com.my.study.design.ruleParallel;

/**
 * @author: yidujun
 * @create: 2021/07/09 17:45
 */
public abstract class AbstractRule<T> implements BaseRule {

    /**
     * 转化
     *
     * @param obj
     * @return
     */
    protected abstract T convert(Object obj);

    @Override
    public boolean execute(Object obj) {
        return executeRule(convert(obj));
    }

    /**
     * 执行
     *
     * @param t
     * @return
     */
    protected abstract  boolean executeRule(T t);
}
